package com.gzh.animatortext.activity

import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.gzh.animatortext.R
import com.gzh.animatortext.databinding.ActivityMainBinding

/**
 * @创建者 顾朝辉
 * @创建时间 2021/5/28 14:07
 * @描述 主界面
 */
class MainActivity : AppCompatActivity(), View.OnClickListener {
    lateinit var binding: ActivityMainBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)
        setClick()
    }

    private fun setClick() {
        binding.button1.setOnClickListener(this)
        binding.button2.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.button1 -> startActivity(Intent(this, NormalActivity::class.java))
            R.id.button2 -> startActivity(Intent(this, CircleActivity::class.java))
        }
    }
}